package cn.matezk.cloud.service.impl;

import cn.matezk.cloud.dao.EventDao;
import cn.matezk.cloud.dto.EventDto;
import cn.matezk.cloud.model.Event;
import cn.matezk.cloud.service.IEventService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EventService implements IEventService {
    @Autowired
    private EventDao eventDao;

    @Override
    public PageInfo<Event> query(EventDto eventDto) {
        PageHelper.startPage(eventDto.getPageNo(), eventDto.getPageSize());
        List<Event> list = eventDao.query(eventDto);
        return new PageInfo<>(list);
    }
}
